<div>
    <h2 id="page-heading">
        <span>Tasks</span>

        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-task" [routerLink]="['/task/new']">
            <fa-icon icon="plus"></fa-icon>
            <span>
            Create a new Task
            </span>
        </button>
    </h2>

    <jhi-alert-error></jhi-alert-error>

    <jhi-alert></jhi-alert>

    <div class="alert alert-warning" id="no-result" *ngIf="tasks?.length === 0">
        <span>No tasks found</span>
    </div>

    <div class="table-responsive" id="entities" *ngIf="tasks && tasks.length > 0">
        <table class="table table-striped" aria-describedby="page-heading">
            <thead>
                <tr>
                    <th scope="col" ><span>ID</span></th>
                    <th scope="col" ><span>Title</span></th>
                    <th scope="col" ><span>Description</span></th>
                    <th scope="col"></th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let task of tasks ;trackBy: trackId">
                    <td><a [routerLink]="['/task', task.id, 'view']">{{ task.id }}</a></td>
                    <td>{{ task.title }}</td>
                    <td>{{ task.description }}</td>
                    <td class="text-right">
                        <div class="btn-group">
                            <button type="submit"
                                    [routerLink]="['/task', task.id, 'view']"
                                    class="btn btn-info btn-sm">
                                <fa-icon icon="eye"></fa-icon>
                                <span class="d-none d-md-inline">View</span>
                            </button>

                            <button type="submit"
                                    [routerLink]="['/task', task.id, 'edit']"
                                    class="btn btn-primary btn-sm">
                                <fa-icon icon="pencil-alt"></fa-icon>
                                <span class="d-none d-md-inline">Edit</span>
                            </button>

                            <button type="submit" (click)="delete(task)"
                                    class="btn btn-danger btn-sm">
                                <fa-icon icon="times"></fa-icon>
                                <span class="d-none d-md-inline">Delete</span>
                            </button>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
